package com.swgk.core.util;

/**
 * 防止弹窗重复显示
 */
public class CommonUtils {
    private static long lastClickTime;

    /**
     * 知识分享发布视频防重复点击实现
     * @return
     */
    public static boolean isFastDoubleClick() {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;
        if (0 < timeD && timeD < 5000) {
            return true;
        }
        lastClickTime = time;
        return false;
    }

    public static boolean buttonClick() {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;
        if (0 < timeD && timeD < 1000) {
            return true;
        }
        lastClickTime = time;
        return false;
    }
}
